package file.a03;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileOutputStreamTest {
    public static void main(String[] args) {
        try(
                FileInputStream fis=new FileInputStream("IO-DEMO.iml");
                FileOutputStream fos=new FileOutputStream("demo.txt"))
        {
            int hasRead=0;
            byte[] bbuf=new byte[1024];
            while((hasRead=fis.read(bbuf))>0){
                fos.write(bbuf,0,hasRead);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
